import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 10 - 19
 * Time: 11:43
 */
//牛客 参数解析
public class Solution13 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            int count = 0;
            for (int i = 0; i < str.length(); i++) {
                if(str.charAt(i) == '"') {
                    do {
                        i++;
                    }while(str.charAt(i) != '"');
                }
                if(str.charAt(i) == ' ') {
                    count++;
                }
            }
            System.out.println(count + 1);
            int flag = 0;
            for (int i = 0; i < str.length(); i++) {
                if(str.charAt(i) == '"') {
                    flag ^= 1;
                }
                if(str.charAt(i) != ' ' && str.charAt(i) != '"') {
                    System.out.print(str.charAt(i));
                }

                if(str.charAt(i) == ' ' && flag == 1) {
                    System.out.print(str.charAt(i));
                }
                if(str.charAt(i) == ' ' && flag == 0) {
                    System.out.println();
                }
            }
        }
    }
}
